/**
 * @ author: 汪孟苹
 */
define(["jquery","template",
	"scprit/followup/app/specialNurse/specialNurse.servers.js",
	"scprit/followup/template/specialNurse/specialNurse.tpl.js"],
	function($,template,$specialNurseServers,tpl){
	var ui = {};

	/**
	 * taskList
	 */
	var drawTabs = function(data){
		return template("tpl_specialNurse_tabs",data);
	}
	ui.tabsInit = function(options){
		$("#"+options.id).html(tpl.init());
		var h = drawTabs($specialNurseServers.handleSpecialTask(options));
		$("#"+options.id).html(h);
	}

	/**
	 * 建档
	 */
	var drawArchive = function(){
		return template("tpl_specialNurse_archive");
	}
	ui.archiveInit = function(options){
		$("#"+options.id).html(tpl.init2());
		var h = drawArchive();
		$("#"+options.id).html(h);
	}

	/**
	 * 方案，建档时供医生选择
	 */
	var drawScheme = function(data){
		return template("tpl_specialNurse_scheme",data);
	}
	ui.schemeInit = function(options){
		$("#"+options.id).html(tpl.init1());
		var h = drawScheme($specialNurseServers.handleScheme(options));
		$("#"+options.id).html(h);
	}

	/**
	 * 右侧
	 */
	var drawRight = function(data){
		return template("tpl_specialNurse_right",data);
	}
	ui.rightInit = function(options){
		$("#"+options.id).html(tpl.init3());
		var h = drawRight($specialNurseServers.handleRight(options.data,options.ptTaskId));
		$("#"+options.id).html(h);
	}

	/**
	 * 问卷
	 */
	var drawTreatmentTask = function(data){
		return template("tpl_specialNurse_treatmentTask",data);
	}
	ui.treatmentTask = function(options){
		$("#"+options.id).html(tpl.treatmentTask());
		var h = drawTreatmentTask(options);
		$("#"+options.id).html(h);
	}

	/**
	 * 今日门诊记录
	 */
	var drawRightOutpatientRecords = function(data){
		return template("tpl_specialNurse_rightOutpatientRecords",data);
	}
	ui.rightOutpatientRecordsInit = function(options){
		$("#"+options.id).html(tpl.init4());
		var h = drawRightOutpatientRecords($specialNurseServers.rightOutpatientRecords(options));
		$("#"+options.id).html(h);
	}

	return ui;
});